package com.er.mq;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
public class Consumer1 {

    private static final Logger LOGGER = LoggerFactory.getLogger(Consumer1.class);

    @JmsListener(destination = JMSConfig.DESTINATION,containerFactory = "queueContainerFactory")
    public void receivedQueue(String msg) {
        LOGGER.info("收到消息 " + JMSConfig.DESTINATION + ", msg: " + msg);
    }
    @JmsListener(destination = JMSConfig.DESTINATION,containerFactory = "topicContainerFactory")
    public void receivedTopic(String msg) {
        LOGGER.info("收到消息 " + JMSConfig.DESTINATION + ", msg: " + msg);
    }
}